<template>
  <view class="page">
    <nav-bar>
      <template #title>扫码</template>
    </nav-bar>
    <view class="container">
      <mumu-get-qrcode
        @success="qrcodeSucess"
        @error="qrcodeError"
      ></mumu-get-qrcode>
    </view>
  </view>
</template>

<script setup lang="ts">
import mumuGetQrcode from "@/components/mumu-getQrcode/mumu-getQrcode.vue";
function qrcodeSucess(data: any) {
  console.log(data, "qrcodeSucess");
  uni.showModal({
    title: "成功",
    content: data,
    success: () => {
      navigateBack();
    },
  });
}
function qrcodeError(data: any) {
  console.log(data, "qrcodeError");
  uni.showModal({
    title: "摄像头授权失败",
    content: "摄像头授权失败，请检测当前浏览器是否有摄像头权限。",
    success: () => {
      navigateBack();
    },
  });
}
</script>

<style>
</style>